#include <bits/stdc++.h>
#define int long long
using namespace std;
int n,N=30;
char s[1000005];
char ch[3],mp[35][35],ans[1000005];
double dis(int x,int y) {
	return sqrt((x - 15) * (x - 15) + (y - 15) * (y - 15));
}
void work() {
	for (int i=1; i <= N; i++)
		for (int j=1; j <= N; j++)
			mp[i][j]=i % 3 == 0 ? ch[2] : ch[(((j - 1) % 4) / 2) ^ (i % 3 - 1)];
	int x=15,y=15,sx=0,sy=0;
	for (int i=1; i <= n; i++) {
		if (mp[x][y] == ch[2]) {
			if (s[i] == ch[2])
				y > 15 ? (y--,ans[i]='L') : (y++,ans[i]='R');
			else
				s[i] == mp[x - 1][y] ? (x--,ans[i]='U') : (x++,ans[i]='D');
		}
		else {
			if (s[i] == mp[x][y])
				y=((y - 1) ^ 1) + 1,ans[i]=y & 1 ? 'L' : 'R';
			else if (s[i] == ch[2])
				x % 3 == 1 ? (x--,ans[i]='U') : (x++,ans[i]='D');
			else {
				int gx1=x % 3 == 1 ? x + 1 : x - 1,gy1=y,gx2=x,gy2=y & 1 ? y - 1 : y + 1;
				if (dis(gx1,gy1) < dis(gx2,gy2))
					ans[i]=gx1 < x ? 'U' : 'D',x=gx1;
				else
					ans[i]=gy2 < y ? 'L' : 'R',y=gy2;
			}
		}
		if (x < 1 || x > N || y < 1 || y > N || mp[x][y] != s[i])
			return ;
		if (i == 1)
			sx=x,sy=y;
	}
	printf("30 30\n");
	for (int i=1; i <= N; i++,putchar('\n'))
		for (int j=1; j <= N; j++)
			putchar(mp[i][j]);
	printf("%lld %lld\n",sx,sy);
	for (int i=2; i <= n; i++)
		putchar(ans[i]);
	exit(0);
}

signed main() {
    freopen("snake.in","r",stdin);
    freopen("snake.out","w",stdout);
	srand(time(NULL));
	scanf("%s",s + 1),n=strlen(s + 1);
	ch[0]='R',ch[1]='G',ch[2]='B',work();
	ch[0]='R',ch[1]='B',ch[2]='G',work();
	ch[0]='G',ch[1]='R',ch[2]='B',work();
	ch[0]='G',ch[1]='B',ch[2]='R',work();
	ch[0]='B',ch[1]='R',ch[2]='G',work();
	ch[0]='B',ch[1]='G',ch[2]='R',work();
	cout << "NO" << endl;
	return 0;
}
